package dataStructures;

import java.util.HashMap;

public class DoubleHashMap<L,R> {
	private HashMap<L, R> _leftMapping;
	private HashMap<R, L> _rightMapping;
	
	public DoubleHashMap()
	{
		_leftMapping = new HashMap<L, R>();
		_rightMapping = new HashMap<R, L>();
	}
	
	public L getLeft(R key)
	{
		return _rightMapping.get(key);
	}
	
	public R getRight(L key)
	{
		return _leftMapping.get(key);
	}
	
	public int size()
	{
		return _leftMapping.size();
	}
	
	public boolean containsLeftKey(L key)
	{
		return _leftMapping.containsKey(key);
	}
	
	public boolean containsRightKey(R key)
	{
		return _rightMapping.containsKey(key);
	}
}
